<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <div id="app1">
      <h2 v-if="isShow">isShow={{isShow}}</h2>
      <table border="1" width="100%">
        <tr>
          <th>序号</th>
          <th>名称</th>
          <th>价格</th>
        </tr>
        <tr v-for="(fruit,index) in fruits">
          <td>{{index+1}}</td>
          <td>{{fruit.name}}</td>
          <td>{{fruit.price}}</td>
        </tr>
      </table>
    </div>
    <script src="./js/vue3.js"></script>
    <script>
      Vue.createApp({
        setup() {
          let isShow = true;

          const fruits = [
            {
              name: "苹果",
              price: "6.8",
            },
            {
              name: "橙子",
              price: "3.5",
            },
            {
              name: "香蕉",
              price: "2.3",
            },
          ];

          return { isShow, fruits };
        },
      }).mount("#app1");
    </script>
  </body>
</html>
